<?
  include('../init.php');

  $img_id= $_POST["imgId"];
  
  $sql = "SELECT img_path FROM gallery WHERE img_id=$img_id";
  $line = $db->queryUniqueObject($sql);
  
  $sql = "DELETE FROM gallery WHERE img_id=$img_id";
  $db->execute($sql);
  
  if(file_exists('../../images/header_slide/'.$line->img_path)){
    unlink('../../images/header_slide/'.$line->img_path);
  }
?>